import os

import django
from celery import Celery

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'Doctor_django.settings.dev')
# django的环境配置
django.setup()

app = Celery('Doctor_django')

# 加载配置文件，表示当前应用celery应用，加载指定路径的settings
app.config_from_object('mycelery.settings', namespace='Doctor_django')

# 加载任务
app.autodiscover_tasks(['mycelery.sms'])
